package com.yiligi.myserver.service;

import com.yiligi.myserver.pojo.DTO.ChangeUserPasswordDTO;
import com.yiligi.myserver.pojo.DTO.UserDTO;
import com.yiligi.myserver.pojo.User;


import java.util.List;

public interface UserService {

    List<User> selectAllUser();

    User selectUserById(int id);

    int insertUser(User user);

    int updateUser(User user);

    Integer deleteUserById(Integer id);

    /**
     * 分页查询
     * @param pageNum
     * @param pageSize
     * @return
     */
    List<User> selectPage(int pageNum, int pageSize, String username, String email, String address);

    Integer selectTotal(String username, String email, String address);

    /**
     * 批量插入
     * @param users
     * @return
     */
    Boolean addBatchUser(List<User> users);

    UserDTO login(UserDTO userDTO);

    Boolean valUserName(String username);

    int registerUser(UserDTO userDTO);

    User selectUserByName(String username);

    Boolean changeUserPassword(ChangeUserPasswordDTO user);
}
